@import '../../styles/var.less';

.k-input[mult] {
  position: relative;
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--kui-color-font);
  // flex-shrink: 0;
  align-items: center;
  border: 1px solid var(--kui-color-border);
  border-radius: var(--kui-border-radius);
  background-color: var(--kui-color-back);
  transition: all .3s ease-in-out;
  box-sizing: border-box;
  font-size: 14px;
  padding: 0 8px;
  gap: 6px;
  height: 32px;
  overflow: hidden;
  line-height: 1.571;

  &:hover {
    border-color: var(--kui-color-main);
  }

  .k-select {
    padding-left: 0;
  }

  .k-input-icon {
    font-size: 16px;
    color: var(--kui-color-icon);
  }

  .k-input-search-icon {
    cursor: pointer;

    &:hover {
      color: var(--kui-color-main);
    }
  }

  .k-input-password-icon {
    color: var(--kui-color-icon);
    cursor: pointer;
    transition: all .2s ease-in-out;

    &:hover {
      color: var(--kui-color-title);
    }
  }

  .k-input-text {
    padding-left: 0;
    border: none;
    // height: 30px;
    line-height: 1;
    padding: 0;
    font-size: 14px;
    color: var(--kui-color-font);
    background-color: transparent;
    background-image: none;
    box-sizing: border-box;
    flex: 1;
    min-width: 10px;
    line-height: 1.571;

    &:focus {
      // border-color: var(--kui-color-main);
      outline: none;
    }

    &::placeholder {
      color: var(--kui-color-disable-color);
    }
  }

  &.k-input-focus {
    border-color: var(--kui-color-main);
    box-shadow: 0 0 0 2px var(--kui-color-main-90);
    z-index: 1;
  }

  .k-input-suffix,
  .k-input-prefix {
    // font-size: 12px;
    white-space: nowrap;
    line-height: 1;
    // cursor: pointer;
    user-select: none;
    transition: all .2s ease-in-out;
    display: flex;

    &:hover {
      color: var(--kui-color-font);
    }

    .k-icon {
      font-size: 16px;
      transition: all .2s ease-in-out;
      color: var(--kui-color-icon);
    }
  }

  &.k-input-circle {
    border-radius: 20px;
  }

  .k-input-suffix-addon {
    margin-right: -8px;
    margin-top: -1px;
    margin-bottom: -1px;

    & *:first-child {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }

}

.k-input[single],
.k-textarea {
  box-sizing: border-box;
  display: inline-block;
  width: 100%;
  height: 32px;
  padding: 4px 10px;
  font-size: 14px;
  margin: 0;
  border: 1px solid var(--kui-color-border);
  border-radius: var(--kui-border-radius);
  color: var(--kui-color-font);
  // background-color: transparent;
  background-color: var(--kui-color-back);
  background-image: none;
  position: relative;
  cursor: text;
  transition: border .3s ease-in-out;
  // flex-shrink: 0;
  line-height: 1.571;

  &:focus {
    // box-shadow: 0 0 5px rgba(59, 180, 242, 0.55);
    box-shadow: 0 0 0 2px var(--kui-color-main-90);
    border-color: var(--kui-color-main);
    outline: none;
  }

  &:hover {
    border-color: var(--kui-color-main);
  }

  &:disabled {
    cursor: not-allowed;
    color: var(--kui-color-disable-color);
    background: var(--kui-color-disable-back);
    border-color: var(--kui-color-disable-border);

    &:hover {
      border-color: var(--kui-color-disable-border);
    }
  }

  &::placeholder {
    color: var(--kui-color-disable-color);
  }

  // &:-webkit-autofill {
  //   box-shadow: 0 0 0px 1000px white inset !important;
  // }
  // &:-webkit-autofill:focus {
  //   box-shadow: 0 0 0px 1000px white inset !important;
  // }
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  // border:none;// 1px solid var(--kui-color-main);
  -webkit-text-fill-color: var(--kui-color-font);
  -webkit-box-shadow: 0 0 0px 1000px var(--kui-color-back) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.k-textarea {
  max-width: 100%;
  min-height: 32px;
  height: auto;
  vertical-align: bottom;
  font-size: 14px;
  line-height: 1.571;
  resize: vertical;
  outline: none;
}

.k-input-clearable {
  cursor: pointer;
  font-size: 15px;
  color: var(--kui-color-gray);

  &:hover {
    color: var(--kui-color-font);
  }
}

.k-input-clearable-hidden,
.k-textarea-clearable-hidden {
  visibility: hidden;
}

.k-textarea-sm {
  font-size: 12px;
}

.k-textarea-lg {
  font-size: 16px;
}

.k-input-sm[single] {
  padding: 2px 4px;
  height: 24px;
  font-size: 12px;
}

.k-input-sm[mult] {
  padding: 0 4px;
  gap: 4px;
  height: 24px;
  font-size: 12px;

  .k-input-text {
    font-size: 12px;
    padding: 2px 0;
  }

  .k-input-clearable {
    font-size: 14px;
  }

  .k-input-icon {
    font-size: 14px;
  }

  .k-input-suffix {
    .k-icon {
      font-size: 12px;
    }
  }

  .k-input-group-suffix,
  .k-input-group-prefix {
    height: 24px;
    font-size: 12px;
  }
}

.k-input-lg[single] {
  padding: 2px 10px;
  height: 40px;
  font-size: 16px;
}

.k-input-group-suffix,
.k-input-group-prefix {
  height: 40px;
  font-size: 14px;

  >[class^="k-"]:not(.k-icon) {
    margin: 0 -1px;
  }
}

.k-input-group-suffix {
  & *:first-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    // background-color: red;
  }
}

.k-input-group-prefix {
  & *:last-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    // background-color: red;
  }
}



.k-input-lg[mult] {
  height: 40px;

  .k-input-text {
    padding: 2px 0;
    font-size: 16px;
  }

  .k-input-clearable {
    font-size: 18px;
  }

  .k-input-icon {
    font-size: 16px;
  }

  .k-input-suffix {
    .k-icon {
      font-size: 18px;
    }
  }
}

::-ms-clear {
  display: none;
}

::-ms-reveal {
  display: none;
}

.k-input-light[mult],
.k-input-light[single],
.k-textarea-light {
  border-color: transparent;
  background-color: var(--kui-color-gray-80);

  &:focus,
  &:hover,
  &.k-input-focus {
    border-color: transparent;
    box-shadow: none;
  }
}

.k-input-circle[single] {
  border-radius: 20px;
}

.k-input-disabled[mult] {
  cursor: not-allowed;
  color: var(--kui-color-disable-color);
  background: var(--kui-color-disable-back);
  border-color: var(--kui-color-disable-border);

  &:hover {
    border-color: var(--kui-color-disable-border);
  }

  & * {
    cursor: not-allowed;
  }
}

.k-input-group-suffix,
.k-input-group-prefix {
  border: 1px solid var(--kui-color-border);
  display: flex;
  border-radius: @radius;
  flex: 1;
  height: 32px;
  line-height: 1;
  box-sizing: border-box;
  align-items: center;
  font-size: 14px;
  transition: all .3s ease-in-out;

  >.k-icon {
    margin: 0 8px;
  }
}

.k-input-group-compact {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
  display: inline-flex;
  border-collapse: separate;
  border-spacing: 0;
  align-items: self-start;



  .k-input-group-first-item {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: -1px;

    &:hover {
      z-index: 1;
    }
  }

  .k-input-group-item {
    border-radius: 0;
    margin-right: -1px;

    &:hover {
      z-index: 1;
    }
  }

  .k-select-open,
  .k-datepicker-open {
    z-index: 1;
  }

  .k-input-group-last-item {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;

    &:hover {
      z-index: 1;
    }
  }
}

.k-input-group-sm {

  .k-input-group-suffix,
  .k-input-group-prefix {
    height: 24px;
    font-size: 12px;
  }

  .k-input-number-suffix,
  .k-input-number-prefix {
    font-size: 12px;
  }
}

.k-input-group-lg {

  .k-input-group-suffix,
  .k-input-group-prefix {
    height: 40px;
    font-size: 16px;
  }

  .k-input-number-suffix,
  .k-input-number-prefix {
    font-size: 16px;
  }
}